<?php namespace Phpcmf\Controllers;

class Home extends \Phpcmf\Common {

	public function index() {

        $id = intval($_GET['id']);
        $data = \Phpcmf\Service::M()->table('app_'.APP_DIR)->get($id);
        !$data && $this->_msg(0, dr_lang('收款主题不存在'));

        $price = floatval($_GET['price']);
        $data['price'] = $data['price'] > 0 ? $data['price'] : $price;

        $mid = 'gathering-'.$id.'-app_'.APP_DIR;

        \Phpcmf\Service::V()->assign($data);
        \Phpcmf\Service::V()->assign([
            'payform' => \Phpcmf\Service::M('Pay')->payform($mid, $data['price'], $data['title'], $data['url']),
        ]);
        \Phpcmf\Service::V()->display($data['template']);
        
    }
}
